<?php
@session_start();
$PurviewLevel=2;
$CheckChannelID=0;  
$PurviewLevel_Others="sys_adminuser";

require("../../inc/common.inc.php");
require_once("../Admin_ChkPurview.php");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<TITLE>铭讯EOS网站后台管理</TITLE>
<Meta name="Keywords" Content="济南网站建设 济南网站制作 山东网站建设 济南铭讯软件有限公司">
<Meta name="Description" Content="济南网站制作：铭讯软件专业服务优秀企业，致力于网站建、设网站推广、网络营销一体的全访位网络服务商">
<link rel="stylesheet" href="../images/style.css" type="text/css">
</head>
<SCRIPT language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除选中的新闻吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;
	 
}
function CheckAdd()
{
  if(document.form1.username.value=="")
    {
      alert("用户名不能为空！");
	  document.form1.username.focus();
      return false;
    }
  if(document.form1.Password.value=="")
    {
	alert("密码不能为空！");
	document.form1.Password.focus();
	return false;
    }
  if((document.form1.Password.value)!=(document.form1.PwdConfirm.value))
    {
      alert("初始密码与确认密码不同！");
	  document.form1.PwdConfirm.select();
	  document.form1.PwdConfirm.focus();	  
      return false;
    }
  if (document.form1.Purview[1].checked==true){
	GetClassPurview();
  }
}
</SCRIPT>
</head>
<body> 
<?php
if ($actions=="saveadd"){
//添加管理员
  if ($username=="" || empty($username)){
  	$fun->popmassage("用户名不能为空，请正确填写！","","popback");
	exit();
  }
  if ($Password=="" || empty($Password)){
  	$fun->popmassage("密码不能为空，请正确填写！","","popback");
	exit();
  }
  if ($PwdConfirm=="" || empty($PwdConfirm)){
  	$fun->popmassage("密码确认不能为空，请正确填写！","","popback");
	exit();
  }
  if ($Password != $PwdConfirm){
  	$fun->popmassage("两次输入密码不一致，请重新输入！","","popback");
	exit();
  }
  $isok=intval($isok);
  //获得操作权限
  if (isset($U_OtherPurview)){
  foreach( $U_OtherPurview AS $key=>$value){
    if ($UOtherPurview=="" || empty($UOtherPurview)){$UOtherPurview.=$value;}
	else{$UOtherPurview.=",".$value;}
  }
  }
  if (isset($fiddb)){
  foreach( $fiddb AS $key=>$value){
	$UArticleIdPurview.="|".$value;
  }
  }
  $UArticleIdPurview.="|";
  
  if ($UPurview=="" || empty($UPurview)){$UPurview=2;}
  if ($UPurview=="1"){
    $UOtherPurview="";
    $UArticleIdPurview="";
    $UArticleIdPurview="";
  }
  $Password=md5($Password);
  $usernum=$db->excu("select username from mx_members where username='$username'");
  $usernum=mysql_num_rows($usernum);
  if ($usernum>0){
  	$fun->popmassage("此管理员已经存在，请重新输入！","","popback");
	exit();
  }
  else{
    $intsql="insert into mx_members (username,realname,password,Purview,Adddate,ArticleIdPurview,OtherPurview,LastLoginIP,LastLoginTime,LoginTimes,isok) VALUES ('$username','$realname','$Password','$UPurview','".date("Y-m-d H:i:s")."','$UArticleIdPurview','$UOtherPurview','127.0.0.1','".date("Y-m-d H:i:s")."','0','$isok')";
    $db->excu($intsql);
	jump2("操作成功","sys_member.php",2);
	exit();
	}
}
elseif($actions=="savemodi"){
//保存修改后的管理员信息
  global $db,$fun;
  if ($uid=="" || empty($uid)){
  	$fun->popmassage("非法访问！","","popback");
	exit();
  }
  if (($Password=="" || empty($Password)) && !($PwdConfirm=="" || empty($PwdConfirm))){
  	$fun->popmassage("密码不能为空，请正确填写！","","popback");
	exit();
  }
  if (($PwdConfirm=="" || empty($PwdConfirm)) && !($Password=="" || empty($Password))){
  	$fun->popmassage("密码确认不能为空，请正确填写！","","popback");
	exit();
  }
  if (($Password != $PwdConfirm) && ($PwdConfirm=="" || empty($PwdConfirm)) && ($Password=="" || empty($Password))){
  	$fun->popmassage("两次输入密码不一致，请重新输入！","","popback");
	exit();
  }
  $isok=intval($isok);
  //获得操作权限

  if (isset($U_OtherPurview)){
  foreach( $U_OtherPurview AS $key=>$value){
    if ($UOtherPurview=="" || empty($UOtherPurview)){$UOtherPurview.=$value;}
	else{$UOtherPurview.=",".$value;}
  }
  }
  if (isset($fiddb)){
  foreach( $fiddb AS $key=>$value){
	$UArticleIdPurview.="|".$value;
  }
  }
  $UArticleIdPurview.="|";

  
  if ($UPurview=="" || empty($UPurview)){$UPurview=2;}
  if ($UPurview=="1"){
    $UOtherPurview="";
    $UArticlePurview="";
    $UArticleIdPurview="";
  }
  if ($UPurview=="1"){
    $UOtherPurview="";
    $UArticleIdPurview="";
    $UArticleIdPurview="";
  }
  elseif ($UPurview=="3"){
    $UOtherPurview="ModifyPwd";
    $UArticleIdPurview="";
    $UArticleIdPurview="";
  }
  
  if(!($PwdConfirm=="" || empty($PwdConfirm)) && !($Password=="" || empty($Password))){
    $Password=md5($Password);
    $upsql="update mx_members set realname='$realname',password='$Password', Purview='$UPurview',ArticleIdPurview='$UArticleIdPurview',OtherPurview='$UOtherPurview',isok='$isok'where uid='$uid'";
  }
  else
  {
    $upsql="update mx_members set realname='$realname',Purview='$UPurview',ArticleIdPurview='$UArticleIdPurview',OtherPurview='$UOtherPurview',isok='$isok' where uid='$uid'";
  }
  $db->excu($upsql);
  $url=url_code($url);
  if (trim($url)==""){$url="sys_member.php";}
  jump2("操作成功","sys_member.php",2);
  exit();
}
elseif($actions=="delall"){
//删除管理员
  global $db,$fun;
  if (!is_array($uid)){
  	$fun->popmassage("您没有选择要操作信息，请重新输入！","","popback");
	exit();
  }
  foreach( $uid as $key=>$value){
    //echo "delete from mx_members where uid='$key' ";
	//exit();
	$db->excu("delete from mx_members where uid='$key' ");
  }
  jump2("操作成功","sys_member.php",2);
  exit();
}
elseif($actions=="delete"){
  global $db,$fun;
  $uid=intval($uid);
  if ($uid==0){
  	$fun->popmassage("您没有选择要操作信息，请重新输入！","","popback");
	exit();
  }
  $db->excu("delete from mx_members where uid='$uid' ");
  jump2("操作成功","sys_member.php",2);
  exit();
}
require("../mx_head.php");?>
<div class="right">
<?php  
if ($actions=="add"){
//添加管理员
?>
<div class="xm2">
<h1 class="fl">添加新用户</h1>
</div>
<div class="xm2_b">
<div class="height15"></div>
<table width="100%" border="0" cellspacing="1" cellpadding="5" class="table_southidc">
  <form name="form1" method="post" action="sys_member.php" onSubmit="return CheckAdd();">
    <tr class="list"> 
      <td width="15%" align="center"><b>用&nbsp;&nbsp;户&nbsp;&nbsp;名：</b></td>
      <td width="85%"> 
        <input type="text" name="username"></td>
    </tr>
    <tr class="list"> 
      <td align="center"><b>真实姓名：</b></td>
      <td> 
        <input type="text" name="realname" value="<?php echo $rsmenber['realname'];?>"></td>
    </tr>
    <tr class="list"> 
      <td align="center"><b>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</b></td>
      <td> 
        <input type="password" name="Password"></td>
    </tr>
    <tr class="list"> 
      <td align="center"><b>重复密码：</b></td>
      <td> 
        <input type="password" name="PwdConfirm"></td>
    </tr>
    <tr class="list">
      <td align="center"><b>用户状态：</b></td>
      <td colspan="2"><input type="radio" name="isok" value="1" class="input_check" checked="checked"/>&nbsp;正常&nbsp;<input type="radio" name="isok" value="0" class="input_check"/>&nbsp;锁定</td>
    </tr>
    <tr class="list"> 
      <td align="center"><strong>权限设置：</strong></td>
      <td><table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr>
          <td width="100">
		    <input name="UPurview" type="radio" value="1" onClick="PurviewDetail.style.display='none'" class="input_check">超级管理员：
		  </td>
          <td>拥有所有权限。</td>
        </tr>
        <tr>
          <td width="100">
		    <input type="radio" name="UPurview" value="2" onClick="PurviewDetail.style.display=''" class="input_check" checked="checked">普通管理员：
		  </td>
          <td>需要详细指定每一项管理权限</td>
        </tr>
      </table>
     </td>
    </tr>
	<tr valign="middle" class="list">
      <td colspan="2">
	    <table id="PurviewDetail" width="100%" border="0" cellspacing="10" cellpadding="0">
          <tr valign="top">
             <td width="49%">           
            <fieldset>
            <legend>网站管理权限</legend>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_vpp_group" class="input_check" <?php echo $U_OtherPurview[user_vpp_group]?>>VPP用户分组</td>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_vpp_user" class="input_check" <?php echo $U_OtherPurview[user_vpp_user]?>>VPP用户管理</td>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_vpp_usermap" class="input_check" <?php echo $U_OtherPurview[user_vpp_usermap]?>>VPP用户地图分布</td>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_app_group" class="input_check" <?php echo $U_OtherPurview[user_app_group]?>>APP用户分组</td>
			  </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="user_app_user" class="input_check" <?php echo $U_OtherPurview[user_app_user]?>>APP用户管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="user_app_usermap" class="input_check" <?php echo $U_OtherPurview[user_app_usermap]?>>APP用户地图分布</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tuisong_vpp" class="input_check" <?php echo $U_OtherPurview[tuisong_vpp]?>>VPP信息推送</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tuisong_reply" class="input_check" checked="checked" <?php echo $U_OtherPurview[tuisong_reply]?>>自助机器人</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_class" class="input_check" <?php echo $U_OtherPurview[yingxiao_vpp_class]?>>VPP栏目管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_indexad" class="input_check" <?php echo $U_OtherPurview[yingxiao_vpp_indexad]?>>VPP幻灯片管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_danye" class="input_check" <?php echo $U_OtherPurview[yingxiao_vpp_danye]?>>VPP单页管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_link" class="input_check" checked="checked" <?php echo $U_OtherPurview[yingxiao_vpp_link]?>>VPP友情链接</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_user" class="input_check" <?php echo $U_OtherPurview[tongji_user]?>>用户增长统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_diqu" class="input_check" <?php echo $U_OtherPurview[tongji_diqu]?>>地区分布统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_msg" class="input_check" <?php echo $U_OtherPurview[tongji_msg]?>>消息统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_huifu" class="input_check" checked="checked" <?php echo $U_OtherPurview[tongji_huifu]?>>回复统计</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_fenxiang" class="input_check" <?php echo $U_OtherPurview[tongji_fenxiang]?>>分享统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_fangwen" class="input_check" <?php echo $U_OtherPurview[tongji_fangwen]?>>访问统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_vpp_config" class="input_check" <?php echo $U_OtherPurview[sys_vpp_config]?>>系统认证</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_config" class="input_check" checked="checked" <?php echo $U_OtherPurview[sys_config]?>>系统设置</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_adminuser" class="input_check" <?php echo $U_OtherPurview[sys_adminuser]?>>后台用户管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_app_" class="input_check" <?php echo $U_OtherPurview[sys_app_]?>>APP信息同步</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_weixin_config" class="input_check" <?php echo $U_OtherPurview[sys_weixin_config]?>>VPP初始步骤</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_weixin_menu" class="input_check" checked="checked" <?php echo $U_OtherPurview[sys_weixin_menu]?>>微信菜单</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="ModifyPwd" class="input_check" <?php echo $U_OtherPurview[ModifyPwd]?>>修改密码</td>
                <td></td><td></td><td></td>
              </tr>
            </table>
            </fieldset>
			<br>
			<fieldset>
            <legend>分类管理权限</legend>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
			<tr><td colspan="2">&nbsp;<input name="U_OtherPurview[10]" type="checkbox" value="shenhe" class="input_check" <?php echo $U_OtherPurview[shenhe]?>>所选栏目审核</td></tr>
<?php
	$fid=intval($fid);
	global $sortdb;
	$sortdb=array();
	list_allsort(0,"mx_vpp_articleclass",2);
foreach($sortdb AS $key=>$rs){
?>
  <tr class="list" onMouseOver="this.className='list2'" onMouseOut="this.className='list'"> 
    <td width="4%" align="center" style="border-bottom:1px dotted #ccc;"><b><font color="#FF0000"><?php echo $rs[fid]?></font></b></td>
    <td width="50%" style="border-bottom:1px dotted #ccc;">
      <input type="checkbox" name="fiddb[<?php echo $rs[fid]?>]" value="<?php echo $rs[fid]?>"   class="input_check">
      <?php echo $rs[icon]?>【<?php echo $rs[name]?>】</td>
  </tr>
<?php }?>
            </table>
            </fieldset>
		  </td>
        </tr>
      </table>
	 </td>
    </tr>
    <tr class="list"> 
      <td height="40" colspan="2" align="center"> 
        <input type="hidden" name="actions" value="saveadd">
        <input type="submit" name="Submit" value="添加新管理员" class="button">
	  </td>
    </tr>
  </form>
</table>
<div class="clear"></div>
<div class="height15"></div>
</div>
<?php
}

elseif ($actions=="modipurview"){
//修改管理员
  global $db,$fun;
  $uid=trim($_REQUEST['uid']);
  if ($uid=="" || empty($uid)){
  	$fun->popmassage("此管理员不存在！","","popback");
	exit();
  }
  $rsmenber=$db->excu("select * from mx_members where uid='$uid' limit 1");
  $rsnum=mysql_num_rows($rsmenber);
  if ($rsnum!=1){
    $fun->popmassage("此管理员不存在！","","popback");
    exit();
  }
  $rsmenber=mysql_fetch_array($rsmenber);

  foreach (explode(",",$rsmenber[OtherPurview]) as $key => $value){
    $U_OtherPurview[$value]="checked";
  }
  if ($gotourl==""){$gotourl=url_encode($_SERVER['HTTP_REFERER']);}
?>
<div class="xm2">
<h1 class="fl">修改用户</h1>
</div>
<div class="xm2_b">
<div class="height15"></div>
<table width="100%" border="0" cellspacing="1" cellpadding="5" class="table_southidc">
  <form name="form1" method="post" action="sys_member.php">
    <tr class="list"> 
      <td width="15%" height="30" align="center"><b>用&nbsp;&nbsp;户&nbsp;&nbsp;名：</b></td>
      <td width="85%"> <?php echo $rsmenber['username'];?>
        <input name="uid" type="hidden" value="<?php echo $rsmenber['uid'];?>"></td>
    </tr>
    <tr class="list"> 
      <td align="center"><b>真实姓名：</b></td>
      <td> 
        <input type="text" name="realname" value="<?php echo $rsmenber['realname'];?>"></td>
    </tr>
    <tr class="list"> 
      <td align="center"><b>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</b></td>
      <td> 
        <input type="password" name="Password"></td>
    </tr>
    <tr class="list"> 
      <td align="center"><b>重复密码：</b></td>
      <td> 
        <input type="password" name="PwdConfirm"></td>
    </tr>
    <tr class="list">
      <td align="center"><b>用户状态：</b></td>
      <td colspan="2"><input type="radio" name="isok" value="1" class="input_check" <?php if ($rsmenber['isok']==1){echo "checked";}?> />&nbsp;正常&nbsp;<input type="radio" name="isok" value="0" class="input_check" <?php if ($rsmenber['isok']==0){echo "checked";}?> />&nbsp;锁定</td>
    </tr>
    <tr class="list"> 
      <td align="center"><strong>权限设置： </strong></td>
      <td><table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr>
          <td width="100">
		    <input name="UPurview" type="radio" value="1" onClick="PurviewDetail.style.display='none'" class="input_check" <?php if ($rsmenber['Purview']==1){echo "checked";} ?>>超级管理员：
		  </td>
          <td>拥有所有权限。</td>
        </tr>
        <tr>
          <td width="100">
		    <input type="radio" name="UPurview" value="2" onClick="PurviewDetail.style.display=''" class="input_check" <?php if ($rsmenber['Purview']==2){echo "checked";} ?>>普通管理员：
		  </td>
          <td>需要详细指定每一项管理权限</td>
        </tr>
      </table>
     </td>
    </tr>
	<tr valign="middle" class="list">
      <td colspan="2">
	    <table id="PurviewDetail" width="100%" border="0" cellspacing="10" cellpadding="0" style="display:<?php if ($rsmenber['Purview']!=2){echo "none";} ?>;">
          <tr valign="top">
             <td width="49%">           
            <fieldset>
            <legend>网站管理权限</legend>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_vpp_group" class="input_check" <?php echo $U_OtherPurview[user_vpp_group]?>>VPP用户分组</td>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_vpp_user" class="input_check" <?php echo $U_OtherPurview[user_vpp_user]?>>VPP用户管理</td>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_vpp_usermap" class="input_check" <?php echo $U_OtherPurview[user_vpp_usermap]?>>VPP用户地图分布</td>
                <td width="25%"><input name="U_OtherPurview[]" type="checkbox" value="user_app_group" class="input_check" <?php echo $U_OtherPurview[user_app_group]?>>APP用户分组</td>
			  </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="user_app_user" class="input_check" <?php echo $U_OtherPurview[user_app_user]?>>APP用户管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="user_app_usermap" class="input_check" <?php echo $U_OtherPurview[user_app_usermap]?>>APP用户地图分布</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tuisong_vpp" class="input_check" <?php echo $U_OtherPurview[tuisong_vpp]?>>VPP信息推送</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tuisong_reply" class="input_check" checked="checked" <?php echo $U_OtherPurview[tuisong_reply]?>>自助机器人</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_class" class="input_check" <?php echo $U_OtherPurview[yingxiao_vpp_class]?>>VPP栏目管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_indexad" class="input_check" <?php echo $U_OtherPurview[yingxiao_vpp_indexad]?>>VPP幻灯片管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_danye" class="input_check" <?php echo $U_OtherPurview[yingxiao_vpp_danye]?>>VPP单页管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="yingxiao_vpp_link" class="input_check" checked="checked" <?php echo $U_OtherPurview[yingxiao_vpp_link]?>>VPP友情链接</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_user" class="input_check" <?php echo $U_OtherPurview[tongji_user]?>>用户增长统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_diqu" class="input_check" <?php echo $U_OtherPurview[tongji_diqu]?>>地区分布统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_msg" class="input_check" <?php echo $U_OtherPurview[tongji_msg]?>>消息统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_huifu" class="input_check" checked="checked" <?php echo $U_OtherPurview[tongji_huifu]?>>回复统计</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_fenxiang" class="input_check" <?php echo $U_OtherPurview[tongji_fenxiang]?>>分享统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="tongji_fangwen" class="input_check" <?php echo $U_OtherPurview[tongji_fangwen]?>>访问统计</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_vpp_config" class="input_check" <?php echo $U_OtherPurview[sys_vpp_config]?>>系统认证</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_config" class="input_check" checked="checked" <?php echo $U_OtherPurview[sys_config]?>>系统设置</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_adminuser" class="input_check" <?php echo $U_OtherPurview[sys_adminuser]?>>后台用户管理</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_app_" class="input_check" <?php echo $U_OtherPurview[sys_app_]?>>APP信息同步</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_weixin_config" class="input_check" <?php echo $U_OtherPurview[sys_weixin_config]?>>VPP初始步骤</td>
                <td><input name="U_OtherPurview[]" type="checkbox" value="sys_weixin_menu" class="input_check" checked="checked" <?php echo $U_OtherPurview[sys_weixin_menu]?>>微信菜单</td>
              </tr>
			  <tr>
                <td><input name="U_OtherPurview[]" type="checkbox" value="ModifyPwd" class="input_check" <?php echo $U_OtherPurview[ModifyPwd]?>>修改密码</td>
                <td></td><td></td><td></td>
              </tr>
            </table>
            </fieldset>
			<br>
			<fieldset>
            <legend>分类管理权限</legend>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
			<tr><td colspan="2">&nbsp;<input name="U_OtherPurview[]" type="checkbox" value="shenhe" class="input_check" <?php echo $U_OtherPurview[shenhe]?>>所选栏目审核</td></tr>
<?php
	$fid=intval($fid);
	global $sortdb;
	$sortdb=array();
	list_allsort(0,"mx_vpp_articleclass",2);
foreach($sortdb AS $key=>$rs){
?>
  <tr class="list" onMouseOver="this.className='list2'" onMouseOut="this.className='list'"> 
    <td width="4%" align="center" style="border-bottom:1px dotted #ccc;"><b><font color="#FF0000"><?php echo $rs[fid]?></font></b></td>
    <td width="50%" style="border-bottom:1px dotted #ccc;">
      <input type="checkbox" name="fiddb[<?php echo $rs[fid]?>]" value="<?php echo $rs[fid]?>"  <?php if(strpos("#**#$rsmenber[ArticleIdPurview]","|$rs[fid]|")>0){ echo " checked ";}?> class="input_check">
      <?php echo $rs[icon]?>【<?php echo $rs[name]?>】</td>
  </tr>
<?php }?>
            </table>
            </fieldset>
		  </td>
        </tr>
      </table>
	 </td>
    </tr>
    <tr class="list"> 
      <td colspan="2" align="center">
	    <input type="hidden" name="url" value="<?php echo $gotourl?>">
        <input type="hidden" name="actions" value="savemodi">
        <input type="submit" name="Submit" value=" 保 存 " class="button">
	  </td>
    </tr>
  </form>
</table>
<div class="clear"></div>
<div class="height15"></div>
</div>
<?php
}

else{
?>
<div class="gk">
			<div class="ti2 fl">用户管理</div>
			<ul class="fr">
				<li><span class="c1"><?php $znum=$db->listcount("mx_members","");echo $znum;?></span><span>总条数</span></li>
				<li class="line"></li>
				<li><span class="c2"><?php $znum=$db->listcount("mx_members"," and Purview='1'");echo $znum;?></span><span>超级管理员</span></li>
				<li class="line"></li>
				<li><span class="c2"><?php $znum=$db->listcount("mx_members"," and Purview<>'1'");echo $znum;?></span><span>普通管理员</span></li>
				<li class="line"></li>
				<li><span class="c2"><?php $znum=$db->listcount("mx_members"," and isok='1'");echo $znum;?></span><span>正常</span></li>
				<li class="line"></li>
				<li><span class="c3"><?php $znum=$db->listcount("mx_members"," and isok='0'");echo $znum;?></span><span>禁用</span></li>
			</ul>
			<div class="clear"></div>
</div>
<div class="height15"></div>

<div class="xm2">
<h1 class="fl">信息管理</h1>
</div>
<div class="xm2_b" style="border-bottom:0px;">
<div class="t">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
	<td>
	<div class="an1"><a href="sys_member.php">用户管理</a></div>
	<div class="an2"><a href="sys_member.php?actions=add">添加用户</a></div>
	<div class="an2"><a href="sys_member.php?isok=1">正常</a></div>
	<div class="an2"><a href="sys_member.php?isok=0">禁用</a></div>
	<div class="an2"><a href="sys_member.php?memberpur=1">超级管理员</a></div>
	<div class="an2"><a href="sys_member.php?memberpur=1">普通管理员</a></div>
	</td>
	</tr>
	</table>
</div>
<div class="t">
<table border="0" cellpadding="0" cellspacing="1" class="search_from">
<form name="form2" action="sys_member.php" method="post">
 <tr>
   <td>
   <select name="type">
   <option value="">用户名</option>
   <option value="uid">用户uid</option>
   </select>
   </td><td>&nbsp;关键字：</td><td><input name="keywords" type="text" id="keywords" value="" size="10" class="search_input"/></td>
   <td>&nbsp;状态：</td>
  <td><select name="isok"><option value="">不限</option><option value="1">正常</option><option value="0">锁定</option></select></td>
  <td><select name="pagesize"><option value="20">20条/页</option><option value="30" <?php if ($pagesize==30){echo "selected";}?>>30条/页</option><option value="50" <?php if ($pagesize==50){echo "selected";}?>>50条/页</option></select></td>
  <td><input type="submit" name="Submit3" value="搜索" class="button2" /></td>
  </tr>
</form>
</table>
</div>
</div>

<div class="xm2_b">
<?php
  $str="";
  $s="";
  if(empty($pageindex)){
      $pageindex=1;
  }
  $pagesize=intval($pagesize);
  if ($pagesize==0){
  	$pagesize=20;
  }

  if ($keywords!=""){
    if ($type=="uid"){
      $str.=" and uid='$keywords'";
	}
	else{
      $str.=" and username='$keywords' ";
	}
  }
  if($isok!=""){
  	$isok=intval($isok);
	$str.=" and isok='$isok' ";
	$s.="isok=$isok&";
  }
  
  if($memberpur!=""){
  	$memberpur=intval($memberpur);
	$str.=" and Purview='$memberpur' ";
	$s.="memberpur=$memberpur&";
  }
  $table=" mx_members ";
  $order=" order by uid desc";
  $column=" * ";
  $biaoid="uid";
  $c=$db->listcount($table,$str);
  
  $list=$db->list1($pageindex,$pagesize,$table,$column,$str,$order,$biaoid);

 ?>
<table width="100%" border="0" cellspacing="1" cellpadding="8" class="table_southidc">
  <tr> 
    <th width="5%" align="center">选择</th>
    <th width="17%" align="center">用户名</th>
    <th width="16%" align="center">最后登录日期</th>
    <th width="13%" align="center">最后登录IP</th>
    <th width="12%" align="center">用户权限</th>
    <th width="9%" align="center">操作</th>
  </tr>
  <form name="form1" id="from1" method="post" action="sys_member.php">
  <?PHp
  if (!is_array($list)){
  echo "<tr class=\"list1\"><td colspan=6><center>暂无信息</center></td></tr>";
  }
  else{
  for($i=0;$i<count($list);$i++){
  ?>
  <tr class="list"> 
    <td width="5%" align="center"><input type="checkbox" name="uid[<?php echo $list[$i]["uid"] ?>]" value="<?php echo $list[$i]["uid"] ?>" class="input_check"></td>
    <td><?php echo $list[$i]["username"] ?></td>
    <td align="center"><?php echo $list[$i]["LastLoginTime"] ?></td>
    <td align="center"><?php echo $list[$i]["LastLoginIP"] ?></td>
    <td align="center"><?php if ($list[$i]["Purview"]==1 ){echo "超级管理员";}else {echo "普通管理员";}?></td>
    <td align="center"><a href="sys_member.php?actions=modipurview&uid=<?php echo $list[$i]["uid"] ?>">修改</a>&nbsp;&nbsp;<a href="sys_member.php?actions=delete&uid=<?php echo $list[$i]["uid"] ?>" onClick="return confirm('你确实要删除此会员吗?')">删除</a></td>
  </tr>
  <?PHP
  }
  }
  ?>
  <input type="hidden" name="actions" value="delall" />
  </form>
</table>
<?php if ($c>0){?>
	<div class="height15"></div>
	<div class="do_div">
	<div class="l"><a href="javascript:CheckAll(document.form1,'all')">全选</a>&nbsp;<a href="javascript:CheckAll(document.form1,'')">反选</a><input type="hidden" name="jobs" value="0"></div>
	<div class="l2">
	选择操作：
	<a href="javascript:if (confirm('确定要删除选中的信息吗？')){postdo('delete');}"/>删除</a>
	</div>
	</div>
	<div class="clear"></div>
<?php }
if ($c>$pagesize){
?>
	<div class="pagination">
	<?PHP
	echo $db->ThePage_mxsoft($s,$pageindex,$c,$pagesize)
	?>
	</div>
<?php }?>

<div class="clear"></div>
<div class="height10"></div>
<div class="clear"></div>
<script type="text/javascript" src="/mxsoft/js/jquerys-1.5.1.js"></script>
<script language="javascript">
$(document).ready(function(){  
	$(".table_southidc tr").mouseover(function(){   
	$(this).addClass("list2");}).mouseout(function(){   
	$(this).removeClass("list2");}) //移除该行的class   
	$(".table_southidc tr:even").addClass("list1");   
});   
</script> 

<script language="javascript">
function postdo(va){
	document.form1.submit();
}
</script>
</div>
<?php 
}
?>
</div>

<?php
require("../mx_foot.php");
?>
<div class="clear"></div>
<div class="height10"></div>
</body>
</html>
